package com.gaotu.demo;

public enum UserStatus {
    ENABLE(1),
    DISABLE(2);
    private final int code;
    UserStatus(int code) {
        this.code = code;
    }
    public int getCode(){
        return this.code;
    }
    public static UserStatus valueOfCode(Integer code) {
        if (code == null){
            return null;
        }
        for (UserStatus userStatus : values()){
            if (userStatus.code == code.intValue()){
                return userStatus;
            }
        }
        return null;
    }
}
